package com.xishu.service.print.kitchen;

import com.xishu.entity.order.Order;
import org.apache.commons.chain.Context;
import org.apache.commons.chain.impl.ChainBase;
import org.apache.commons.chain.impl.ContextBase;

import java.util.Arrays;
import java.util.List;

public class PrintItemChain extends ChainBase {
    public PrintItemChain(Order orderInDb, List<Long> orderItemIdList) {
        addCommand(new InitCmd(orderInDb, orderItemIdList));
        addCommand(new ListPrinterCmd(orderInDb, orderItemIdList));
    }

    public static void main(String[] args) throws Exception {
        PrintItemChain printItemChain = new PrintItemChain(null, Arrays.asList(1l, 2l));
        Context ctx = new ContextBase();
        printItemChain.execute(ctx);
    }

}
